package com.ruoyi.eqmonitor.smdtv.service.impl;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.eqmonitor.smdtv.domain.Smdtv18;
import com.ruoyi.eqmonitor.smdtv.mapper.Smdtv18Mapper;
import com.ruoyi.eqmonitor.smdtv.mapper.SmregisterMapper;
import com.ruoyi.eqmonitor.smdtv.service.ISmdtv18Service;
import com.ruoyi.eqmonitor.utils.Constant;
import com.ruoyi.eqmonitor.utils.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * 排水户Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-06
 */
@Service
public class Smdtv18ServiceImpl extends ServiceImpl<Smdtv18Mapper, Smdtv18> implements ISmdtv18Service {
    
    @Resource
    private Smdtv18Mapper smdtv18Mapper;

    @Resource
    private SmregisterMapper smregisterMapper;

    @Override
    public Smdtv18 selectSmdtv18ById(Long id){
        return smdtv18Mapper.selectSmdtv18ById(id,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_18.getName()));
    }
      
    @Override
    public List<Smdtv18> selectSmdtv18List(Smdtv18 smdtv18,Integer pageNum,Integer pageSize){
        return smdtv18Mapper.selectSmdtv18List(smdtv18,
                smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_18.getName()),
                pageNum,
                pageSize);
    }

    @Override
    public Long getTotal(Smdtv18 smdtv18) {
        return smdtv18Mapper.getTotal(smdtv18,
                smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_18.getName()));
    }

    @Override
    public List<Smdtv18> getAll() {
        return smdtv18Mapper.getAll(smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_18.getName()));
    }

    @Override
    public boolean save(Smdtv18 smdtv18) {
        return smdtv18Mapper.save(smdtv18,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_18.getName())) > 0;
    }

    @Override
    public boolean updateById(Smdtv18 smdtv18) {
        return smdtv18Mapper.updateById(smdtv18,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_18.getName())) > 0;
    }

    @Override
    public boolean removeByIds(List<Long> ids) {
        return smregisterMapper.removeByIds(ids,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_18.getName())) > 0;
    }

}
